<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<rich:panel header="#{messages['package.mgmt.label']}">
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>
	
	<h:panelGrid width="100%">
		<h:panelGroup>
		    <h:outputText value="#{messages['package.add.label']}" styleClass="sub_header" />
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
		</h:panelGroup>
	</h:panelGrid>
	
	<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
		<h:outputText></h:outputText>
		<t:message for="packageCode" styleClass="error"></t:message>
		
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="packageCode" value="#{messages['package.code.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputText id="packageCode" required="true" size="50" maxlength="50" styleClass="standardText" value="#{adminPackageBean.packageP.packageCode}"></t:inputText>
		
		<h:outputText></h:outputText>
		<t:message for="packageDesc" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="packageDesc" value="#{messages['package.desc.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputTextarea id="packageDesc" required="true" rows="5" cols="50" styleClass="standardText" value="#{adminPackageBean.packageP.packageDesc}"></t:inputTextarea>
	

		<h:outputText></h:outputText>
		<t:message for="partner" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="partner" value="#{messages['partner']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
			<t:selectOneMenu id="partner" styleClass="standardText" value="#{adminPackageBean.selectedPartner.partnerId}" required="true">
				<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
				<f:selectItems value="#{adminPackageBean.selectPartners}"/>
			</t:selectOneMenu>
		</h:panelGroup>


		<h:outputText></h:outputText>
		<t:message for="calendarCate" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="calendarCate" value="#{messages['package.calendar.group.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
			<t:selectOneMenu id="calendarCate" styleClass="standardText" value="#{adminPackageBean.calendarCategory.calendarCatId}" required="true">
				<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
				<f:selectItems value="#{adminPackageBean.selectCalendarCategory}"/>
			</t:selectOneMenu>
		</h:panelGroup>
		
	
		<h:outputText></h:outputText>
		<t:message for="noOfNights" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="noOfNights" value="#{messages['package.no.of.nights.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<t:inputText id="noOfNights" required="true" size="3" maxlength="3" styleClass="standardText" value="#{adminPackageBean.packageP.noOfNights}"></t:inputText>
		
		<%-- 
		<h:outputText></h:outputText>
		<t:message for="packageType" styleClass="error"></t:message>
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="packageType" value="#{messages['package.type.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    <t:selectOneRadio id="packageType" layout="lineDirection" required="true" styleClass="standardText" value="#{adminPackageBean.packageP.packageType}" >
		    	<f:selectItems  value="#{adminPackageBean.selectPackageType}" />
		    </t:selectOneRadio> 
		</h:panelGroup>	
		--%>
		
		<h:outputText  rendered="false"></h:outputText>
		<t:message for="packageChargeType" styleClass="error"  rendered="false"></t:message>
		
		<h:panelGroup rendered="false">
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="packageChargeType" rendered="false" value="#{messages['package.charge.type.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup rendered="false">
		    <t:selectOneRadio id="packageChargeType"  layout="lineDirection" required="false" styleClass="standardText" value="#{adminPackageBean.packageP.chargeType}" >
		    	<f:selectItems  value="#{adminPackageBean.selectChargeType}" />
		    </t:selectOneRadio> 
		</h:panelGroup>
		
		
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="wdPointCate" value="#{messages['package.wd.point.category.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
			<t:selectOneMenu id="wdPointCate" styleClass="standardText" value="#{adminPackageBean.wdPointCate.pointCatId}" required="true">
				<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
				<f:selectItems value="#{adminPackageBean.selectPointCategory}"/>
			</t:selectOneMenu>
		</h:panelGroup>
		
		<h:panelGroup>
			<h:outputText value="*" styleClass="standardText_Mandatory" />
			<h:outputLabel for="wePointCate" value="#{messages['package.we.point.category.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
			<t:selectOneMenu id="wePointCate" styleClass="standardText" value="#{adminPackageBean.wePointCate.pointCatId}" required="true">
				<f:selectItem itemLabel="#{messages['please.select']}" itemValue="" />
				<f:selectItems value="#{adminPackageBean.selectPointCategory}"/>
			</t:selectOneMenu>
		</h:panelGroup>
		
		<h:outputText value="Normal Rates" styleClass="standardText_Label" />
		<h:panelGroup>
		    <t:panelGrid columns="2" width="80%" >
		    	<h:panelGroup>
		    		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_40,standardTable_ColumnLeft_60" width="100%">
						<h:outputText></h:outputText>
						<t:message for="wdPoint" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wdPoint" value="#{messages['package.point.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wdPoint" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekdayPoint}"></t:inputText>
						
						<%-- 
						<h:outputText></h:outputText>
						<t:message for="wdDesirePoint" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wdDesirePoint" value="#{messages['package.desire.point.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wdDesirePoint" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekdayDesirePoint}"></t:inputText>
						--%>
				    </t:panelGrid>
		    	</h:panelGroup>
		    	<h:panelGroup>
		    		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_40,standardTable_ColumnLeft_60" width="100%">
						<h:outputText></h:outputText>
						<t:message for="wdPrice" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wdPrice" value="#{messages['package.price.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wdPrice" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekdayPrice}"></t:inputText>
						<%-- 
						<h:outputText></h:outputText>
						<t:message for="wdDesirePrice" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wdDesirePrice" value="#{messages['package.desire.price.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wdDesirePrice" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekdayDesirePrice}"></t:inputText>
						--%>			    	
			    	</t:panelGrid>
		    	</h:panelGroup>
		    </t:panelGrid>
		</h:panelGroup>
		
		<h:outputText value="Peak Rates" styleClass="standardText_Label" />
		<h:panelGroup>
		    <t:panelGrid columns="2" width="80%" >
		    	<h:panelGroup>
		    		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_40,standardTable_ColumnLeft_60" width="100%">
						<h:outputText></h:outputText>
						<t:message for="wePoint" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wePoint" value="#{messages['package.point.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wePoint" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekendPoint}"></t:inputText>
						<%-- 
						<h:outputText></h:outputText>
						<t:message for="weDesirePoint" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="weDesirePoint" value="#{messages['package.desire.point.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="weDesirePoint" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekendDesirePoint}"></t:inputText>
						--%>
				    </t:panelGrid>
		    	</h:panelGroup>
		    	<h:panelGroup>
		    		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_40,standardTable_ColumnLeft_60" width="100%">
						<h:outputText></h:outputText>
						<t:message for="wePrice" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="wePrice" value="#{messages['package.price.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="wePrice" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekendPrice}"></t:inputText>
						<%-- 
						<h:outputText></h:outputText>
						<t:message for="weDesirePrice" styleClass="error"></t:message>
						
						<h:panelGroup>
							<h:outputText value="*" styleClass="standardText_Mandatory" />
							<h:outputLabel for="weDesirePrice" value="#{messages['package.desire.price.label']}" styleClass="standardText_Label" />
						</h:panelGroup>
						<t:inputText id="weDesirePrice" required="true" size="10" maxlength="10" styleClass="standardText" value="#{adminPackageBean.packageP.weekendDesirePrice}"></t:inputText>
						--%>			    	
			    	</t:panelGrid>
		    	</h:panelGroup>
		    </t:panelGrid>
		</h:panelGroup>
		



		<h:outputText></h:outputText>
		<t:message for="effectiveDate" styleClass="error"></t:message>
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="effectiveDate" value="#{messages['effective.date.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    	<t:inputCalendar
		    	id="effectiveDate"
					monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
					currentDayCellClass="currentDayCell" value="#{adminPackageBean.packageP.effectiveDate}"
					renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
					popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
					renderPopupButtonAsImage="true"
					styleClass="standardText" required="true"
		    	>
		    	</t:inputCalendar>
		</h:panelGroup>
		
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="expiryDate" value="#{messages['expiry.date.label']}" styleClass="standardText_Label" />
		</h:panelGroup>
		<h:panelGroup>
		    	<t:inputCalendar
		    	id="expiryDate"
					monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
					currentDayCellClass="currentDayCell" value="#{adminPackageBean.packageP.expiryDate}"
					renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
					popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
					renderPopupButtonAsImage="true"
					styleClass="standardText" required="true"
		    	>
		    	</t:inputCalendar>
		</h:panelGroup>

		<rich:spacer height="10"></rich:spacer>
		
		<t:panelGroup>
		   <t:panelGrid columns="2">
		   		<h:commandButton value="#{messages['create']}" styleClass="button" action="#{adminPackageBean.addPackageAction}" actionListener="#{adminPackageBean.addPackageActionEvent}"></h:commandButton>
			    <h:commandButton value="#{messages['back']}" styleClass="button" action="#{adminPackageBean.initPackageSetupAction}" immediate="true"></h:commandButton>
		   </t:panelGrid>
		</t:panelGroup>
	</t:panelGrid>
	
	
</rich:panel>	